package com.lanchewuyou.user.driver.yancheui;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;

import com.lanchewuyou.user.driver.R;
import com.lanchewuyou.user.driver.modul.Config;

/**
 * 上传验车车辆相关信息
 */
public class YancheCarInforActivity extends AppCompatActivity implements View.OnClickListener {

    private SeekBar seekBar;
    private TextView youweiText;
    private ImageButton yancheCarInfoBack;
    private EditText yancheCarInfoChepai,yancheCarInfoDistance;
    private Button yancheCarinfoNext;
    private static String DRIVERID;
    private Toast toast = null;

    private void showTextToast(String msg) {
        if (toast == null) {
            toast = Toast.makeText(this, msg, Toast.LENGTH_SHORT);
        } else {
            toast.setText(msg);
        }
        toast.show();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_yanche_car_infor);
        SharedPreferences sharedPreferences = getSharedPreferences(Config.PASSWORD_PATH, Activity.MODE_PRIVATE);
        DRIVERID = sharedPreferences.getString("driverid", "");
        initViews();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {

            default:
                break;
        }
    }

    private void initViews() {
        yancheCarInfoBack=(ImageButton)findViewById(R.id.yanche_carinfo_back);yancheCarInfoBack.setOnClickListener(this);
        yancheCarinfoNext=(Button)findViewById(R.id.yanche_carinfo_next_btn);yancheCarinfoNext.setOnClickListener(this);
        yancheCarInfoChepai=(EditText)findViewById(R.id.yanche_carinfo_input_carmodel);
        yancheCarInfoDistance=(EditText)findViewById(R.id.yanche_carinfo_input_distance);
        seekBar = (SeekBar) findViewById(R.id.yanche_carinfo_seekbar);
        youweiText = (TextView) findViewById(R.id.yanche_carinfo_youwei);
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                youweiText.setText(progress + "%");
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });


    }

}
